home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / manage / snmp / kip / doc / rev1086 < prev    next >
Encoding:
Text File  |  1989-01-17  |  11.4 KB  |  249 lines

  1. 10/86 REVISION OF IP-ETHER/APPLETALK GATEWAY CODE
  2.  
  3. The October 1986 Stanford revision of the IP-ether/appletalk gateway
  4. code (KIP) is used with the Kinetics KFPS.  It contains the following
  5. new features over the previous, 'KUDP' / seagate release.  Some of
  6. these items will be discussed in more detail below.
  7.  
  8.     Improved IP address management.
  9.  
  10.     Centralized configuration/booting control.
  11.  
  12.     Full routing using NBP/RTMP/ZIP;  'core' gateway scheme.
  13.  
  14.     Gateway debugging via symbolic net ddt.
  15.  
  16.     Simple integration with libraries such as CAP/KHOST.
  17.  
  18.     Improved packet throughput.
  19.  
  20.  
  21. IP ADDRESSING
  22.  
  23. IP nets/subnets are no longer tied directly to appletalk net numbers.
  24. If your Mac applications are only using appletalk protocols (not
  25. MacIP), then only one IP address needs to be assigned, that of the
  26. gateway itself.
  27.  
  28. If Mac applications use IP protocols, then each Mac must be assigned a
  29. unique IP address.  In the past this was done by assigning an IP net or
  30. IP subnet number to the appletalk cable, then placing a 'customization
  31. file' on each Mac containing its unique IP address.  There are a number
  32. of administrative reasons this is not a good approach:  (1) the custom
  33. file must be carefully configured and not accidently copied or moved to
  34. another machine/cable.  (2) IP net/subnet numbers are valuable
  35. resources in certain campuses and companies;  assigning one per
  36. appletalk cable can be wasteful.  (3) the old IP address 'ARP' (address
  37. resolution protocol) scheme does not work through 'standard' appletalk
  38. bridges such as the Hayes.
  39.  
  40. For these reasons, the gateway code now manages appletalk IP
  41. addresses in a new fashion.  This is described in detail in the file
  42. 'ip.at' in this directory.  Briefly, the gateway can be configured so
  43. that it takes over responsibility for a 'range' of IP addresses on the
  44. ethernet side of the gateway.  These addresses can be dynamically or
  45. staticly bound to MacIP clients on the appletalk side.  Typically a
  46. MacIP client program will ask the gateway for an IP address assignment
  47. each time the client program (such as Telnet or FTP) executes.  The
  48. gateway remembers these assignments (even after the client exits) and
  49. thus the mapping used between IP address and appletalk address remains
  50. relatively fixed.  Appletalk NBP (name binding protocol) is used to
  51. provide the ARP function.
  52.  
  53.  
  54. GATEWAY CONFIGURATION / BOOTING CONTROL
  55.  
  56. Rather than each gateway physical site having to edit and maintain a
  57. detailed download configuration file, this function is now controlled
  58. by an 'appletalk administrator' host / daemon.
  59.  
  60. Each gateway is only configured with a few basic items at download
  61. time, such as the IP/ether address of itself and the IP addresses
  62. of the admin host, and the nearest 'real' gateway.  This information
  63. is placed in a special 'read only' section of the gateway RAM along
  64. with the TEXT and DATA of the gateway program.
  65.  
  66. When the gateway is powered up or restarts, it asks the admin host for
  67. the rest of its configuration, and for the initial routing table
  68. showing the next hop IP address for all appletalk net numbers.
  69. After this time the admin host is no longer needed and the gateways
  70. keep each other informed of dynamic additions to the appletalk topology
  71. (such as a Hayes bridge), as they are plugged in.
  72.  
  73. The appletalk admin daemon, /etc/atalkad, runs on the admin host and
  74. usually just answers requests from booting gateways (a rare
  75. occurance).  However the daemon can also be signaled to propagate new
  76. routing or config info out to all the gateways.  This simplifies
  77. administration.  Another file in this directory, 'install' describes
  78. the daemon and how to setup its database file, /etc/atalkatab.  A
  79. sample atalkatab is also provided with extensive comments.
  80.  
  81.  
  82. ROUTING PROTOCOLS
  83.  
  84. This is an outline description of how appletalk routing works in the
  85. new gateway code.  At boot time the initial routing table is obtained
  86. from the admin host.   This downloaded table is an array of structures
  87. with the following fields:
  88.  
  89.     appletalk net number (anet)
  90.     flags
  91.     IP net or host address
  92.     zone name
  93.  
  94. The flags show what kind of appletalk net this IP address represents,
  95. either a kbox acting as a gateway to the anet, or an IP net/subnet
  96. representing the anet (typically an ethernet segment).  For the latter
  97. case, other flags show what format of directed broadcast address is
  98. used to reach all hosts on that ether segment.  Provision is also
  99. made for IP nets that dont offer directed broadcast (discouraged).
  100. Yet another flag shows which gateways are marked as 'core' gateways,
  101. that are used to centralize dynamic updates, discussed below.
  102.  
  103. In the routing table inside the gateway, further fields and flags are
  104. available to describe other aspects of the anet entry.  For example,
  105. the 'hop count' field is used in the appletalk routing update
  106. algorithms.  For use in the discussion below, we characterize the type
  107. of route entry with the following keywords.
  108.  
  109.     hop0 - there are only two routes in the table with hop count
  110.         equal to 0, these are the directly connected cables to
  111.         the ethernet and appletalk.
  112.     local - this kind of route points to an appletalk node number
  113.         of a bridge accessible on the directly connected appletalk.
  114.     IP - this route points to another kbox or to an IP net.
  115.     AA - this route was downloaded from the appletalk administrator
  116.         in the initial route table.  AA routes are a subset of
  117.         IP routes;  IP routes can include nets discovered
  118.         dynamically.
  119.  
  120. Within the gateway code, the following subroutine functions are invoked
  121. as described upon timer expiration or packet input:
  122.  
  123.     RTMPTIMER runs every 10 seconds and broadcasts an RTMP packet
  124.     to the directly connected appletalk cable.  (10 seconds seems
  125.     short but this is the Apple standard).  This causes the campus
  126.     route situation to propagate out thru any bridges on the
  127.     appletalk cable.
  128.  
  129.     RTMPTIMER (every 20 seconds) ages the route table.  AA and hop0
  130.     routes are excluded from aging.  Routes are deleted if they are
  131.     age >= 40 seconds (local routes) or >= 5 minutes (IP routes).
  132.  
  133.     RTMPINPUT is called when an RTMP packet is received from the
  134.     appletalk segment (from other bridges).  It updates and adds
  135.     local routes;  doesnt touch hop0 or IP routes.
  136.  
  137.     ARTTIMER.  'art' stands for 'arouteTuple'.  This is an extended
  138.     form of routing packet sent between gateways.  It contains
  139.     information similar to the RTMP packets, but also contains IP
  140.     address information.  ARTTIMER runs every 60 seconds.  If the
  141.     gateway hasnt yet obtained its initial routing table, it asks
  142.     the admin host to send one.  Otherwise ARTTIMER sends any local
  143.     additions in its table to ONE of the core gateways (but never
  144.     itself).  The core is chosen by circularly scanning the table
  145.     for an entry so flagged.  In other words if there are two
  146.     core's marked, the updates will be sent alternately to them.
  147.  
  148.     ARTINPUT is called when an arouteTuple arrives.  It could have
  149.     been sent by the admin host (opcode ROUTEI, 'initial'), by the
  150.     arttimer above (ROUTEQ, 'query') or as a response to a ROUTEQ,
  151.     (opcode ROUTE).  If it was a ROUTEI, all previous AA routes are
  152.     purged before merging additions.  Hop0 and local routes are
  153.     never affected;  after merging additions/changes the gateway
  154.     checks the op code again.  If it was ROUTE, we're done.  If it
  155.     was ROUTEQ (query), we respond with another arouteTuple
  156.     containing all of our own non-AA routes.  If it was ROUTEI we
  157.     simply send an acknowledgement so that the admin host knows we
  158.     got it ok.
  159.  
  160. Now that we have a valid route table, processing NBP BrRq's (bridge
  161. requests) is simple:  the gateway just goes down the table, sending a
  162. LkUp directed broadcast request to each net.  The gateway throttles
  163. itself so that it doesnt fill all the output queues or deny incoming
  164. packets while performing this broadcast propagation.
  165.  
  166. As a form of misconfiguration and security protection, the artinput
  167. function in the gateway only accepts routing packets from other
  168. 'trusted' gateways:  i.e. from the admin host or one of the kboxes
  169. configured initially in the database.
  170.  
  171.  
  172. SYMBOLIC DDT DEBUGGER
  173.  
  174. To aid in debugging the running gateway, some code was added to an
  175. existing ddt program to allow network access to the address space in
  176. the gateway.  The ddt, object file, and symbol table reside on UNIX and
  177. simple deposit/examine packets are sent to the gateway.  A 'debug host'
  178. is setup as part of the gateway configuration and only requests from
  179. this host (and in the privileged socket range, superusers only) are
  180. allowed.  To invoke ddt call it as "ddt gw.sym IP_name_or_address".
  181.  
  182. We have found it useful for monitoring/changing tables, statistics
  183. counters and such.  There is also a (kludge) way of printing gateway
  184. generated packets (if an etherwatcher isnt on your desk):  just setup
  185. to send the IP packet to an 'undefined' IP address;  since these stay
  186. in the ARP cache for a few minutes, you have time to find the packet in
  187. the cache and print it out.
  188.  
  189. Since the KFPS checksum/powercycle restart code also depends on the
  190. TEXT/DATA portion of RAM staying intact, a new operation was added to
  191. ddt to do a memory compare between the running gateway and the object
  192. file on UNIX.  Another operation allows toggling between the display of
  193. the gateway address space and the object file.
  194.  
  195.  
  196. LIBRARY INTEGRATION
  197.  
  198. Talking to the new gateway code is simple for UNIX libraries such
  199. as CAP (or KHOST).  A configuration file exists per host showing the
  200. appletalk addresses of the host itself, and its closest appletalk
  201. gateway (which may not be on the same ether cable).  We have modified
  202. CAP to look in the file /etc/atalk.local, an example of which is shown
  203. here:
  204.  
  205.     # mynet mynode myzone 
  206.     123 9 MyZoneName
  207.     # bridgenet bridgenode bridgeIP
  208.     123 240 36.9.0.240
  209.  
  210. Routing for the host is straightforward:  the host keeps variables
  211. source_anet, source_anode, and source_IPaddress which are reset by each
  212. incoming appletalk packet.  Now when the host wants to send, if the
  213. appletalk address the host is sending to matches source_anet /
  214. source_anode, the host can send the appletalk packet directly to
  215. source_IPaddress.  This will be the address of a kbox or another ether
  216. host.  If there is no match, the host simply sends to the 'bridgeIP'
  217. address found in /etc/atalk.local.  The gateway will do the proper
  218. appletalk forwarding.  Eventually as a connection becomes established,
  219. the host will naturally have cached the addresses of the peer at the
  220. other end and thus the appletalk packet can be routed directly.
  221.  
  222. Similarly, NBPLookup's from the UNIX host are sent to the nearest
  223. gateway for directed broadcast propagation to all appletalk nets
  224. (including the host's own).
  225.  
  226. It would be great if the UNIX host could somehow determine its nearest
  227. bridge and appletalk addresses dynamically by sending or listening for
  228. special packets from the gateways.  But we havent figured out how to do
  229. this for the general case when the gateway may be several hops away,
  230. behind non-appletalk speaking gateways.  If you have some ideas, please
  231. post them to info-applebus.
  232.  
  233.  
  234. IMPROVED THROUGHPUT AND ORGANIZATION
  235.  
  236. The new code has an improved organization that does less buffer copying
  237. and handles / routes packets more consistently.  Kinetics and Columbia
  238. have contributed mods to the ethernet device driver code that perform
  239. DMA directly to and from the buffer pool.  (The original seagate driver
  240. had to contend with separate buffer memory on the Interlan NI3210
  241. interface card).
  242.  
  243. We've made some steps toward reducing the Kinetics dependencies for the
  244. dozen or so 'original' seagate builders out there, but this will not
  245. be completed until next release.  (I'm surprised people are still using
  246. that prototype hardware.)
  247.  
  248.     --Bill Croft, Stanford University, CSLI.
  249.